<template>
  <div>
    <bgHeader title="收藏列表" />
    <div class="main">
      <gghouseList v-if="favorateList.length" :getHouseList="favorateList" />
      <van-empty v-else>
        <template #description>
          <span
            >您还没有收藏的房源，<span class="color">去收藏房源</span>吧~</span
          >
        </template>
      </van-empty>
    </div>
  </div>
</template>

<script>
import bgHeader from '@/components/gbhearder'
import gghouseList from '@/components/gghouseList'
import { getFavoriteApi } from '@/api'
export default {
  name: 'favorate',
  components: {
    bgHeader,
    gghouseList
  },
  props: {},
  data() {
    return {
      favorateList: []
    }
  },
  computed: {},
  watch: {},
  created() {
    this.getFavorateList()
  },
  methods: {
    async getFavorateList() {
      this.$toast.loading({
        message: '加载中...',
        forbidClick: true,
        timeout: 3000
      })
      const { data: res } = await getFavoriteApi()
      this.favorateList = res.body
    }
  }
}
</script>

<style scoped lang="less">
.main {
  padding: 92px 0 0 0;
}
</style>
